// eslint-disable-next-line
import { UserLayout, BasicLayout, BlankLayout } from '@/layouts'
import accountRoute from '@/views/account/route'
import bannerRoute from '@/views/banner/route'

/**
 * 基础路由 不需要权限的
 * @type
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  }
]

/** 需要权限的 */
export const asyncRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  },
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    children: [
      {
        path: 'baseConfig',
        name: 'baseConfig',
        meta: {
          title: '配置管理',
          icon: 'account'
        },
        component: BlankLayout,
        children: [
          ...accountRoute,
          ...bannerRoute
        ]
      }
      // {
      //   path: 'baseConfig',
      //   name: 'baseConfig',
      //   meta: {
      //     title: '配置管理',
      //     icon: 'account'
      //   },
      //   component: BlankLayout,
      //   children: [
      //     {
      //       path: 'banner',
      //       name: 'banner',
      //       component: Banner,
      //       alwaysShow: true,
      //       meta: {
      //         title: 'banner管理',
      //         icon: 'banner'
      //       }
      //     },
      //     {
      //       path: 'account',
      //       name: 'account',
      //       component: Account,
      //       alwaysShow: true,
      //       meta: {
      //         title: '账号管理',
      //         icon: 'account'
      //       }
      //     }
      //   ]
      // }
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]
